// pages/category/category.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    currentTab: 0,  //对应样式变化
    scrollTop: 0,  //用作跳转后右侧视图回到顶部
    screenArray: [
      {
        screenId:1,
        screenName:'新品'
      },
      {
        screenId: 2,
        screenName: '高端定制'
      },
      {
        screenId: 3,
        screenName: '展厅现货'
      },
      {
        screenId: 4,
        screenName: '客厅'
      },
      {
        screenId: 5,
        screenName: '卧室'
      },
      {
        screenId: 6,
        screenName: '书房'
      },
      {
        screenId: 7,
        screenName: '餐厅'
      }
    ], //左侧导航栏内容
    screenId: "",  //后台查询需要的字段
    childrenArray: {
      childrenScreenArray: [
        {
          childrenScreenArray: [
            {
              screenId: 1,
              showImageUrl: '/images/pic1.png',
              screenName: 'BZDZLCX系列'
            },
            {
              screenId: 2,
              showImageUrl: '/images/pic2.png',
              screenName: 'BZDZLLY系列'
            },
            {
              screenId: 2,
              showImageUrl: '/images/pic3.png',
              screenName: 'CGLZJ系列'
            },
            {
              screenId: 2,
              showImageUrl: '/images/pic4.png',
              screenName: 'CHLBS系列'
            },
            {
              screenId: 2,
              showImageUrl: '/images/pic5.png',
              screenName: 'CGLXY系列'
            }
          ]
        }
      ]
    }, //右侧内容
  },

  onLoad: function (options) {
    var that = this;
  },
  navbarTap: function (e) {
    var that = this;
    console.log(e);
    this.setData({
      currentTab: e.currentTarget.id, //按钮CSS变化
      screenId: e.currentTarget.dataset.screenid,
      scrollTop: 0, //切换导航后，控制右侧滚动视图回到顶部
    })
    //刷新右侧内容的数据
    var screenId = this.data.screenId;

  }


})
